package aa.jx.cartFunction.model;

import java.util.Date;



public class Cart {

    private Integer id;           // 购物车商品编号
    private Integer userId;       // 用户ID
    private Integer productId;    // 商品ID
    private Integer quantity;     // 商品数量
    private Date created;         // 加入购物车的时间

    // 无参构造函数
    public Cart() {
    }

    // 带参构造函数，用于添加商品到购物车
    public Cart(Integer userId, Integer productId, Integer quantity) {
        this.userId = userId;
        this.productId = productId;
        this.quantity = quantity;
    }

    // Getter和Setter方法
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }









}
